import IService from "./isGetprojectService";//设计图
import projectType from "../../model/getProject";//提前规定好的数据类型
import request from "../../request/axios";
import { AxiosPromise } from "axios";
import axios from "axios"
import downloadFile from "../../model/fileService";
class Service implements IService { //根据设计图来设计
    getaProject(data: projectType): AxiosPromise { //获取报告列表
        return request({
            url: '/getProject/',
            method: "post",
            data,
        })
    }
    getProjectTable(params: projectType): AxiosPromise {  //获取报告列表表头信息
        return request({
            url: "http://localhost:2345/reportTitle/",
            method: "get",
            params
        })
    }
    downLoadFile(params: downloadFile): AxiosPromise {
        return request({
            url: '/downloadFile/',
            method: 'get',
            responseType: "blob",
            params
        })
    }
    updateProject(data: downloadFile): AxiosPromise {
        return request({
            url: '/updateProject/',
            method: 'post',
            data
        })
    }
    uploadFile(data: any): AxiosPromise {
        return request({
            url: '/uploadFile/',
            method: 'post',
            headers: {
                'Content-Type': 'multipart/form-data'
            },
            data
        })
    }
    parseFile(data: downloadFile): AxiosPromise {
        return request({
            url: '/parseFile/',
            method: 'post',
            data
        })
    }
    createProject(data: projectType): AxiosPromise {
        return request({
            url: '/createProject/',
            method: 'post',
            data
        })
    }
    getProjectInfo(data: { projectId: string }): AxiosPromise {
        return request({
            url: '/getProjectInfo/',
            method: 'post',
            data
        })
    }
    getParseResult(data: { projectId: string }): AxiosPromise {
        return request({
            url: '/getParseResult/',
            method: 'post',
            data
        })
    }
    prospectusInsert(data: { projectId: string }): AxiosPromise {
        return request({
            url: '/prospectusInsert/',
            method: 'post',
            data
        })
    }

}

export default new Service();